# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>

pkgname='python-jax'
pkgver=0.7.0
pkgrel=1
pkgdesc='Composable transformations of Python+NumPy programs'
arch=('any')
url='https://github.com/jax-ml/jax/'
license=('Apache-2.0')
groups=('jax')
depends=(
    'python-jaxlib>=0.7.0'
    'python-ml-dtypes'
    'python-numpy'
    'python-opt_einsum'
    'python-scipy'
)
optdepends=(
    'python-protobuf: Australis'
    'python-requests: Distributed computations'
)
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("jax-${pkgver}.tar.gz::$url/archive/refs/tags/jax-v${pkgver}.tar.gz")
sha256sums=('518966801e4402667e77915c2dc7cf1a178a80e22ff253204a837f207a87fcde')

build() {
    JAX_RELEASE=$pkgver python -m build -nw jax-jax-v$pkgver
}

package() {
    cd jax-jax-v$pkgver
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    python -m installer --compile-bytecode=1 --destdir=$pkgdir \
        dist/jax-$pkgver-*.whl
}
